#include "client.hpp"

int main()
{
    Client client;

    client.ShmGet();

    client.Shmattach();
    std::cout << "attach done..." << std::endl;

    char *a = (char *)client.GetAddr();
    // sleep(5);
    std::cout << "2";

    while (true)
    {
        sleep(1);
        std::cout << "Client Write: " << std::endl;
        std::string sendmessage("i am process A");
        strcpy(a, sendmessage.c_str());
        a[sendmessage.size()] = 0;
    }

    if (client.Shmdattach() == -1)
    {
        std::cout << "dattach error" << std::endl;
    }
    std::cout << "dattach done..." << std::endl;
    // sleep(5);
    return 0;
}